home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1989-12-15 | 10.1 KB | 433 lines | [ TEXT/MSWD]
MPW 3.0 interfaces for the OffScreen Support package of 32 Bit QD: { Created: Sunday, March 26, 1989 at 7:30 PM Offscreen.p Pascal Interface to the Macintosh Libraries Copyright Apple Computer, Inc. 1985-1989 All rights reserved } {$IFC UNDEFINED UsingIncludes} {$SETC UsingIncludes := 0} {$ENDC} {$IFC NOT UsingIncludes} UNIT Offscreen; INTERFACE {$ENDC} {$IFC UNDEFINED UsingOffscreen} {$SETC UsingOffscreen := 1} {$I+} {$SETC OffscreenIncludes := UsingIncludes} {$SETC UsingIncludes := 1} {$IFC UNDEFINED UsingQuickdraw} {$I $$Shell(PInterfaces)Quickdraw.p} {$ENDC} {$SETC UsingIncludes := OffscreenIncludes} CONST { New error codes } cDepthErr = -157; { Set of flags used by Offscreen routines } Type GWorldFlags = SET OF ( pixPurge, noNewDevice, gWorldFlag2, gWorldFlag3, gWorldFlag4, gWorldFlag5, pixelsPurgeable, pixelsLocked, gWorldFlag8, gWorldFlag9, gWorldFlag10, gWorldFlag11, gWorldFlag12, gWorldFlag13, gWorldFlag14, gWorldFlag15, mapPix, newDepth, alignPix, newRowBytes, reallocPix, gWorldFlag21, gWorldFlag22, gWorldFlag23, gWorldFlag24, gWorldFlag25, gWorldFlag26, gWorldFlag27, clipPix, stretchPix, ditherPix, gwFlagErr ); TYPE GWorldPtr = CGrafPtr; FUNCTION NewGWorld (VAR offscreenGWorld: GWorldPtr; pixelDepth: INTEGER; boundsRect: Rect; cTable: CTabHandle; aGDevice: GDHandle; flags: GWorldFlags): QDErr; INLINE $7000,$AB1D; FUNCTION LockPixels (pm: PixMapHandle): Boolean; INLINE $7001,$AB1D; PROCEDURE UnlockPixels (pm: PixMapHandle); INLINE $7002,$AB1D; FUNCTION UpdateGWorld (VAR offscreenGWorld: GWorldPtr; pixelDepth: INTEGER; boundsRect: Rect; cTable: CTabHandle; aGDevice: GDHandle; flags: GWorldFlags): GWorldFlags; INLINE $7003,$AB1D; PROCEDURE DisposeGWorld (offscreenGWorld: GWorldPtr); INLINE $7004,$AB1D; PROCEDURE GetGWorld (VAR port: CGrafPtr; VAR gdh: GDHandle); INLINE $7005,$AB1D; PROCEDURE SetGWorld (port: CGrafPtr; gdh: GDHandle); INLINE $7006,$AB1D; PROCEDURE CTabChanged (ctab: CTabHandle); INLINE $7007,$AB1D; PROCEDURE PixPatChanged (ppat: PixPatHandle); INLINE $7008,$AB1D; PROCEDURE PortChanged (port: GrafPtr); INLINE $7009,$AB1D; PROCEDURE GDeviceChanged (gdh: GDHandle); INLINE $700A,$AB1D; PROCEDURE AllowPurgePixels (pm: PixMapHandle); INLINE $700B,$AB1D; PROCEDURE NoPurgePixels (pm: PixMapHandle); INLINE $700C,$AB1D; FUNCTION GetPixelsState (pm: PixMapHandle): GWorldFlags; INLINE $700D,$AB1D; PROCEDURE SetPixelsState (pm: PixMapHandle; state: GWorldFlags); INLINE $700E,$AB1D; FUNCTION GetPixBaseAddr (pm: PixMapHandle): Ptr; INLINE $700F,$AB1D; FUNCTION NewScreenBuffer (globalRect: Rect; purgeable: BOOLEAN; VAR gdh: GDHandle; VAR offscreenPixMap: PixMapHandle): QDErr; INLINE $7010,$AB1D; PROCEDURE DisposeScreenBuffer (offscreenPixMap: PixMapHandle); INLINE $7011,$AB1D; FUNCTION GetGWorldDevice (offscreenGWorld: GWorldPtr): GDHandle; INLINE $7012,$AB1D; {$ENDC} { UsingOffscreen } {$IFC NOT UsingIncludes} END. {$ENDC} /************************************************************ Created: Thursday, March 23, 1989 at 7:25 PM Offscreen.h C Interface to the Macintosh Libraries Copyright Apple Computer, Inc. 1985-1989 All rights reserved ************************************************************/ #ifndef __OFFSCREEN__ #define __OFFSCREEN__ #ifndef __QUICKDRAW__ #include <Quickdraw.h> #endif /* New error codes */ #define cDepthErr -157 /* invalid pixel depth */ /* Flag bits passed to or returned by Offscreen routines */ enum { pixPurgeBit = 0, noNewDeviceBit = 1, pixelsPurgeableBit = 6, pixelsLockedBit = 7, mapPixBit = 16, /* set if color table mapping occurred */ newDepthBit = 17, /* set if pixels were scaled to a different depth */ alignPixBit = 18, /* set if pixels were realigned to screen alignment */ newRowBytesBit = 19, /* set if pixmap was reconfigured in a new rowBytes */ reallocPixBit = 20, /* set if offscreen buffer had to be reallocated */ clipPixBit = 28, /* set if pixels were or are to be clipped */ stretchPixBit = 29, /* set if pixels were or are to be stretched/shrinked */ ditherPixBit = 30, gwFlagErrBit = 31 }; typedef enum { pixPurge = 1 << pixPurgeBit, noNewDevice = 1 << noNewDeviceBit, pixelsPurgeable = 1 << pixelsPurgeableBit, pixelsLocked = 1 << pixelsLockedBit, mapPix = 1 << mapPixBit, newDepth = 1 << newDepthBit, alignPix = 1 << alignPixBit, newRowBytes = 1 << newRowBytesBit, reallocPix = 1 << reallocPixBit, clipPix = 1 << clipPixBit, stretchPix = 1 << stretchPixBit, ditherPix = 1 << ditherPixBit, gwFlagErr = 1 << gwFlagErrBit }GWorldFlag; typedef long GWorldFlags; /* Type definition of a GWorldPtr */ typedef CGrafPtr GWorldPtr; #ifdef __safe_link extern "C" { #endif pascal QDErr NewGWorld (GWorldPtr *offscreenGWorld, short pixelDepth, Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) = {0x7000,0xAB1D}; pascal Boolean LockPixels (PixMapHandle pm) = {0x7001,0xAB1D}; pascal void UnlockPixels (PixMapHandle pm) = {0x7002,0xAB1D}; pascal GWorldFlags UpdateGWorld (GWorldPtr *offscreenGWorld, short pixelDepth, Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) = {0x7003,0xAB1D}; pascal void DisposeGWorld (GWorldPtr offscreenGWorld) = {0x7004,0xAB1D}; pascal void GetGWorld (CGrafPtr *port, GDHandle *gdh) = {0x7005,0xAB1D}; pascal void SetGWorld (CGrafPtr port, GDHandle gdh) = {0x7006,0xAB1D}; pascal void CTabChanged (CTabHandle ctab) = {0x7007,0xAB1D}; pascal void PixPatChanged (PixPatHandle ppat) = {0x7008,0xAB1D}; pascal void PortChanged (GrafPtr port) = {0x7009,0xAB1D}; pascal void GDeviceChanged (GDHandle gdh) = {0x700A,0xAB1D}; pascal void AllowPurgePixels (PixMapHandle pm) = {0x700B,0xAB1D}; pascal void NoPurgePixels (PixMapHandle pm) = {0x700C,0xAB1D}; pascal GWorldFlags GetPixelsState (PixMapHandle pm) = {0x700D,0xAB1D}; pascal void SetPixelsState (PixMapHandle pm, GWorldFlags state) = {0x700E,0xAB1D}; pascal Ptr GetPixBaseAddr (PixMapHandle pm) = {0x700F,0xAB1D}; pascal QDErr NewScreenBuffer (Rect *globalRect, Boolean purgeable, GDHandle *gdh, PixMapHandle *offscreenPixMap) = {0x7010,0xAB1D}; pascal void DisposeScreenBuffer (PixMapHandle offscreenPixMap) = {0x7011,0xAB1D}; pascal GDHandle GetGWorldDevice (GWorldPtr offscreenGWorld) = {0x7012,0xAB1D}; #ifdef __safe_link } #endif #endif ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Created: Friday, March 24 at 10:57 AM ; ; File: OffscreenTraps.a ; ; Assembler Interface to the Macintosh Libraries ; Copyright Apple Computer, Inc. 1984-1989 ; All Rights Reserved ; ;___________________________________________________________________________ ; ; Offscreen Equates -- This file defines the equates for Offscreen ; routines. ;___________________________________________________________________________ ; New Error codes cDepthErr equ -157 ; invalid pixel depth ; Flag bits passed to or returned by UpdateGWorld purgePixBit equ 0 ; make the offscreen buffer purgeable noNewDeviceBit equ 1 ; don't create an offscreen device pixelsPurgeableBit equ 6 ; pixels are pureable pixelsLockedBit equ 7 ; pixels are locked mapPixBit equ 16 ; set if color table mapping occurred newDepthBit equ 17 ; set if pixels were scaled to a different depth alignPixBit equ 18 ; set if pixels were realigned to screen alignment newRowBytesBit equ 19 ; set if pixmap was reconfigured in a new rowBytes reallocPixBit equ 20 ; set if offscreen buffer had to be reallocated clipPixBit equ 28 ; set if pixels were or are to be clipped stretchPixBit equ 29 ; set if pixels were or are to be stretched/shrinked ditherPixBit equ 30 ; set if pixels were or are to be dithered gwFlagErrBit equ 31 ; sign bit set indicates error ; Mask equivalents of the above bits purgePix equ $1 noNewDevice equ $2 pixelsPurgeable equ $40 pixelsLocked equ $80 mapPix equ $10000 newDepth equ $20000 alignPix equ $40000 newRowBytes equ $80000 reallocPix equ $100000 clipPix equ $10000000 stretchPix equ $20000000 ditherPix equ $40000000 gwFlagErr equ $80000000 ;___________________________________________________________________________ ; ; Offscreen Equates -- This defines the macros for the Offscreen ; Traps. ;___________________________________________________________________________ ; All Offscreen Routines go through one trap with a selector _Offscreen OPWORD $AB1D MACRO _NewGWorld MOVEQ #0,D0 _Offscreen ENDM MACRO _LockPixels MOVEQ #1,D0 _Offscreen ENDM MACRO _UnlockPixels MOVEQ #2,D0 _Offscreen ENDM MACRO _UpdateGWorld MOVEQ #3,D0 _Offscreen ENDM MACRO _DisposeGWorld MOVEQ #4,D0 _Offscreen ENDM MACRO _GetGWorld MOVEQ #5,D0 _Offscreen ENDM MACRO _SetGWorld MOVEQ #6,D0 _Offscreen ENDM MACRO _CTabChanged MOVEQ #7,D0 _Offscreen ENDM MACRO _PixPatChanged MOVEQ #8,D0 _Offscreen ENDM MACRO _PortChanged MOVEQ #9,D0 _Offscreen ENDM MACRO _GDeviceChanged MOVEQ #10,D0 _Offscreen ENDM MACRO _AllowPurgePixels MOVEQ #11,D0 _Offscreen ENDM MACRO _NoPurgePixels MOVEQ #12,D0 _Offscreen ENDM MACRO _GetPixelsState MOVEQ #13,D0 _Offscreen ENDM MACRO _SetPixelsState MOVEQ #14,D0 _Offscreen ENDM MACRO _GetPixBaseAddr MOVEQ #15,D0 _Offscreen ENDM MACRO _NewScreenBuffer MOVEQ #16,D0 _Offscreen ENDM MACRO _DisposeScreenBuffer MOVEQ #17,D0 _Offscreen ENDM MACRO _GetGWorldDevice MOVEQ #18,D0 _Offscreen ENDM ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Developers using a development different from MPW are encouraged to get in touch with the publisher of the package they use to ask for the interfaces required.